<!-- 自定义搜索框 组件 -->
<template>
  <div id="search-box">
    <div class="search-input-icon-box" @mouseenter="iconFlag = !iconFlag" @mouseleave="iconFlag = !iconFlag">
      <img v-show="iconFlag" src="../../../assets/icon-search-white.png" class="search-input-icon" alt="">
      <img v-show="!iconFlag" src="../../../assets/icon-search-blue.png" class="search-input-icon" alt="">
    </div>
    <input type="text" class="search-input" placeholder="搜索"/>
  </div>
</template>

<script>
export default {
  name: 'search-box',
  components: {
  },
  data () {
    return {
      iconFlag: true
    }
  },
  computed: {
  },
  methods: {
  }
}
</script>

<style scoped>
  #search-box {
    height: 50px;
    width: auto;
    float: right;
    padding: 0 15px 0 15px;
    position: relative;
  }

  /* 修改输入框 提示词颜色 */
  input::-webkit-input-placeholder{color: #d2d2d2;}
  input::-moz-placeholder{color: #d2d2d2;}  /* Mozilla Firefox 19+ */
  input:-moz-placeholder{color: #d2d2d2;}   /* Mozilla Firefox 4 to 18 */
  input:-ms-input-placeholder{color: #d2d2d2;} /* Internet Explorer 10-11 */

  .search-input {
    height: 30px;
    width: 200px;
    float: right;
    background-color: rgba(213, 213, 213, 0.16);
    border: 1px solid #252a2f;
    padding: 10px 30px 10px 10px;
    color: #fff;
    outline: none;
    font-size: 12px;
    font-weight: normal;
    margin-top: 10px;
    transition-duration: 0.5s;
    -moz-transition-duration: 0.5s; /* Firefox 4 */
    -webkit-transition-duration: 0.5s; /* Safari 和 Chrome */
    -o-transition-duration: 0.5s; /* Opera */
  }

  .search-input:hover {
    width: 250px;
    border: 1px solid #33cde5;
    background-color: rgba(255, 255, 255, 0);
  }

  .search-input-icon-box {
    height: 15px;
    width: 25px;
    margin-top: 18px;
    padding-left: 5px;
    position: absolute;
    right: 15px;
    cursor: pointer;
    border-left: 1px solid #6d6d6d;
  }

  .search-input-icon {
    height: 12px;
    width: 12px;
  }
</style>
